<template>
  <!--数据列表-->
  <div class="results_item box-border h-180px flex items-center bg-#fff p-15px"
       v-for="(item, index) in data" style="cursor: pointer" :key="index">
    <!-- 这里的路径和参数根据你的实际情况设置 -->
    <div class="index text-center text-16px">{{
        index + 1 < 10 ? '0' + (index + 1) : index + 1
      }}
    </div>
    <div>
      <img class="border-2px border-#e0e3e9 border-solid" height="160"
           :src="JSON.parse(item.fn_cover)[0].url || '@/assets/images/error.png'" alt=""/>
    </div>
    <div class="results_content m-l-10px h-100% w-85% flex text-13px">
      <div class="title" v-html="item.fn_title"></div>
      <div class="code"><b>出版年月：</b><span class="m-l-1px">{{item.fn_pubdate?item.fn_pubdate.substring(0,7):''}}</span></div>
      <el-tooltip effect="light" placement="top">
        <template #content>
          <div class="popper" v-html="item.fn_brief"></div>
        </template>
        <div class="abstract cursor-pointer"><b>摘要：</b>
          <span v-html="item.fn_brief.replace(/<[^>]*>/g, '')"></span>
        </div>
      </el-tooltip>
      <div :class="[item.author ? 'author' : '']">
        <p>
          <b>作者：</b><span v-html="item.fn_author"></span>
        </p>
      </div>
      <div class="press">
        <p> <b>出版社：</b><span v-html="item.fn_publishername"></span></p>
      </div>
      <div class="keywords">
        <p>
          <b>关键字：</b>
          <span
            v-for="(it, ind) in item.fn_keyword ? item.fn_keyword.split('  ') : []"
            :key="ind"
          >{{it}}</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import {propTypes} from '@/utils/propTypes'

defineOptions({name: 'AdvBookList'})

const props = defineProps({
  data: propTypes.array.def([]),
  keyword: propTypes.string.def('')
})

</script>

<style lang="scss" scoped>
::v-deep(.vjs-big-play-button) {
  top: calc((160px - 1.63332em) / 2);
  left: calc((250px - 3em) / 2);
}

// ::v-deep(.demo-image__error .image-slot) {
//   font-size: 30px;
// }

// ::v-deep(.demo-image__error .image-slot .el-icon) {
//   font-size: 30px;
// }

// ::v-deep(.demo-image__error .el-image) {
//   width: 100%;
//   height: 200px;
// }

.input-with-suffix-icon {
  ::v-deep(.el-input__suffix) {
    font-size: 20px;
  }
}

@font-face {
  font-family: HarmonyOS;
  src: url('@/assets/font/HarmonyOS_Sans_SC_Regular.ttf');
}

p {
  padding: 0;
  margin: 0;
}

*,
body,
html {
  font-family: HarmonyOS;
  user-select: none;
  /* 火狐 */
  /* 选中文字时避免出现蓝色背景 */
  user-select: none;
  /* webkit浏览器 */
  /* 选中文字时避免出现蓝色背景 */
  user-select: none;
  /* IE10 */
  /* 选中文字时避免出现蓝色背景 */
  user-select: none;
  /* 选中文字时避免出现蓝色背景 */
}

.containers {
  flex-direction: column;
  font-family: 'Microsoft YaHei';

  .header {
    position: relative;
    min-height: 200px;
    background: url('../../assets//imgs/headerbg.png') no-repeat;
    background-size: 100% 100%;

    .logo {
      position: absolute;
      top: 20px;
      left: 50;

      img {
        vertical-align: middle;
      }

      span {
        margin-top: 2px;
        font-size: 14px;
        color: #fff;
      }
    }

    .retrievalPart {
      height: 100%;
      margin: auto;
      flex-direction: column;
      justify-content: space-evenly;

      .searchMethod {}

      .retrieval {
        height: 100%;
        flex-direction: column;
        justify-content: space-evenly;

        .form {
          display: flex;
          overflow: auto;
          flex-direction: column;

          &::-webkit-scrollbar {
            width: 8px; // y轴滚动条宽度
            height: 5px; // x轴滚动条宽度
            background-color: #207073;
            border-radius: 5px;
          }

          &::-webkit-scrollbar-thumb {
            background-image: -webkit-gradient(linear,
              left bottom,
              left top,
              color-stop(0.44, #039595));
            border-radius: 5px;
            box-shadow: inset 0 0 6px #f4f4f5;
          }

          .form_item {
            padding: 0;
            margin: 0;
          }
        }

        .searchSelect {
          line-height: 45px;
          border-radius: 25px 0 0 25px;
          outline: none;
          box-shadow: 0 0 0 0.5px var(--el-input-border-color, var(--el-border-color)) inset;

          option {
            height: 45px;
            line-height: 45px;
          }
        }

        .retrievalInput {
          border-radius: 0;
        }

        :deep(.el-input-group__append) {
          width: 30px;
          font-size: 28px;
          color: #fff;
          background-color: #039595;
          border-radius: 0 25px 25px 0;
        }
      }
    }
  }

  .typeList {
    padding-left: 10px;

    ul {
      li {
        flex-direction: column;
        margin: 0 10px;

        p {
          margin: 0;
        }

        span {
          font-size: 13px;
        }
      }
    }
  }

  .sort {
    max-height: 40px;
    min-height: 40px;

    .retrievalValue {}

    .sortList {
      .item {
        display: flex;
        width: 100px;
        font-size: 14px;
        cursor: pointer;
        align-items: center;
      }

      .activeSort {
        font-weight: bold;
        color: #039595;
      }
    }
  }

  .contents {
    flex: 1;
    overflow-y: auto;

    .classification {
      width: 200px;
      overflow-y: auto;
      box-sizing: border-box;

      &::-webkit-scrollbar {
        width: 8px; // y轴滚动条宽度
        height: 5px; // x轴滚动条宽度
        background-color: #fff;
        border-radius: 5px;
      }

      &::-webkit-scrollbar-thumb {
        background-image: -webkit-gradient(linear,
          left bottom,
          left top,
          color-stop(0.44, rgb(60 186 146)));
        border-radius: 5px;
        box-shadow: inset 0 0 6px #f4f4f5;
        transition: 0.3s ease-in-out;
      }
    }

    .results {
      width: calc(100% - 240px);
      margin: 0 20px;
      flex-direction: column;

      .searchResults {
        height: calc(100% - 55px);
        overflow-y: auto;

        &::-webkit-scrollbar {
          width: 8px; // y轴滚动条宽度
          height: 5px; // x轴滚动条宽度
          background-color: #fff;
          border-radius: 5px;
        }

        &::-webkit-scrollbar-thumb {
          background-image: -webkit-gradient(linear,
            left bottom,
            left top,
            color-stop(0.44, rgb(60 186 146)));
          border-radius: 5px;
          box-shadow: inset 0 0 6px #f4f4f5;
          transition: 0.3s ease-in-out;
        }

        .results_item {
          margin: 10px 0;
          border-radius: 5px;
          box-shadow: 0 0 0 2px #f4f4f5;

          &:first-child {
            margin-top: 2;
          }

          img {
            margin: 0 15px;
            border-radius: 2px;
          }

          .index {
            font-weight: 500;
          }

          .results_content {
            flex-direction: column;
            justify-content: space-between;

            .title {
              font-size: 16px;
              // line-height: 25px;
              font-weight: 500;
            }

            .abstract {
              width: 99%;
              overflow: hidden;
              line-height: 20px;
              color: #999;
              text-overflow: ellipsis;
              white-space: nowrap;

              b {
                width: 50px;
                color: #000;
              }
            }

            b {
              font-size: 14px;
              font-weight: normal;
            }

            .author {
              display: flex;

              p {
                span {
                  text-decoration: underline;
                }
              }
            }

            .keywords {
              span {
                margin-right: 10px;
                // color: #4e6ef2;
                // text-decoration: underline;
              }
            }
          }
        }
      }
    }

    .paging {
      display: flex;
      width: 100%;
      height: 55px;
      background-color: #fff;
      border-radius: 5px;
      justify-content: center;
      align-items: center;
    }
  }
}

:deep(.el-checkbox--default) {
  height: 45px !important;
  line-height: 45px;
  color: #fff;
}

:deep(.el-checkbox__inner) {
  background-color: transparent;
}

:deep(.is-focus) {
  box-shadow: 0 0 0 0.5px var(--el-input-border-color, var(--el-border-color)) inset;
}

:deep(.el-pager) li {
  color: #4e6ef2;
}

:deep(.el-input__wrapper) li {
  box-shadow: 0 0 0 0.5px var(--el-input-border-color, var(--el-border-color)) inset !important;
}

:deep(.is-checked) .el-checkbox__inner {
  background-color: #039595;
}

:deep(.el-checkbox__inner)::after {
  border: 2px solid transparent;
  border-top: 0;
  border-left: 0;
}

:deep(.btn-next),
:deep(.btn-prev) {
  width: 70px;
  color: #4e6ef2;
  background-color: #f4f4f4 !important;
  border-radius: 5px;
}

:deep(.el-input-group__prepend) {
  padding: 0;
  border-radius: 25px 0 0 25px;
}

:deep(.el-row) {
  width: 100%;
  margin-bottom: 10px;
}

.popper {
  max-width: 500px !important;
}

.addbtn {
  width: 40px;
  margin-top: 2px;
  font-size: 20px;
  background-color: #207073;
}

.btn {
  width: 150px;
  height: 38px;
}

.searchBtn {
  display: flex;
  width: 100%;
  margin: auto;
  justify-content: center;
  align-items: center;

  .el-button {
    width: 70px;
    padding: 17px;
    box-sizing: border-box;

    &:first-child {
      background-color: #207073;
    }
  }
}

:deep(.el-tree-node__expand-icon) {
  display: none;
}

:deep(.is-focusable) {
  background-color: #039595;
}

:deep(.el-tree-node__children) {
  .is-expanded {
    max-height: 500px;
    overflow: auto;

    &::-webkit-scrollbar {
      width: 0; // y轴滚动条宽度
    }
  }

  .el-tree-node__content {
    .el-checkbox {
      // padding-left: 30px;
      display: inline-block;
      box-sizing: border-box;
    }
  }

  .el-tree-node {
    background-color: #207073;
  }
}

:deep(.el-tree-node__content) {
  height: 40px;

  .el-checkbox {
    display: none;
    margin-top: 5px;
    margin-right: 2px;
  }

  .treeContent {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &:hover {
    background-color: #039595 !important;
  }
}

:deep(.el-tree-node.is-current > .el-tree-node__content) {
  background-color: transparent !important;
}

:deep(.el-input-group__append) {
  .searchbtn {
    padding: 0;
  }
}

:deep(.d-play-btn) {
  width: 45px;
  height: 45px;

  i {
    margin-left: 3px;
    font-size: 20px !important;
  }
}

:deep(.d-tool-item) {
  padding: 0 6px !important;
  box-sizing: border-box;

  i {
    font-size: 16px !important;
  }
}

:deep(.d-control-tool) {
  padding: 0 !important;
}

:deep(.d-player-state) {
  bottom: 50%;
  transform: translateY(40%);
}

.search-content {
  margin-left: 15px;
}
.el-tree-node__content{
  padding-left: 30px;
}
</style>
